import utils from '../common/utils'
import zhCN from './packs/zhCN'

function install(app) {
    app.config.globalProperties.$t = (tpl, args) => {
        let fieldList = tpl.split('.')
        let value = zhCN
        for (let field of fieldList) {
            value = value[field]
        }
        value = utils.formatStr(value, args)
        return value
    }
}

export default {
    install
}